package com.bkgy.jobs;

import com.bkgy.jobs.outputL3Listener.WatchCal1630PdoL3Service;
import com.bkgy.jobs.outputL3Listener.WatchCal2150PdoL3Service;
import com.bkgy.jobs.outputL3Listener.WatchCgl1870PdoL3Service;
import com.bkgy.jobs.outputL3Listener.WatchTcm2280PdoL3Service;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 定时依次巡查4个产量表是否有新轧卷产生
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class WatchOutputJob {
    private final WatchTcm2280PdoL3Service tcm2280;
    private final WatchCal2150PdoL3Service cal2150;
    private final WatchCal1630PdoL3Service cal1630;
    private final WatchCgl1870PdoL3Service cgl1870;

    public void exec() {
        try {
            tcm2280.exec();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

        try {
            cal2150.exec();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

        try {
            cal1630.exec();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

        try {
            cgl1870.exec();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }
    }
}
